import axios from '../axios.helper'
import { ILoginEntity } from '@/types'


export function useUserAPI() {
    return {
        login(entity: ILoginEntity): Promise<any> {
            return axios.post( "/login", entity)
        },
        sendVcode(email: string): Promise<any> {
            return axios.post('/sendEmail', { email: email });
        },
        getUserInfo(): Promise<any> {
            return axios.get( "/getUserInfo");
        },
        setUserName(name: string): Promise<any> {
            return axios.post('/setUserInfo', { name: name });
        }
     
    }
}